import os
import django
from django import http, shortcuts
import datetime
from gmultiserver.utils import config as cfg

def mkDfltParams():
	params = {}
	params['now'] = datetime.datetime.now()
	return params

def index(request):
	"""Initial page"""
	params = mkDfltParams()
	params['text'] = "Welcome"
	return shortcuts.render_to_response("index.html", params)

"""
def list(request):
  #list page
  params = mkDfltParams()
  params['text'] = "Servers"
  tb1 = []
  for i in cfg.s.itervalues():
    tb1.append([i.name, i.desc])
  params['tb1'] = tb1
  return shortcuts.render_to_response("list.html", params)
"""

def bar(request):
	params = mkDfltParams()
	return shortcuts.render_to_response("chart.html", params)

def not_found(request):
	""" 404 """
	params = mkDfltParams()
	return shortcuts.render_to_response("404.html", params)
